<div class="content-wrapper">
    <?php
    $form = $this->form;
    $form->prepare();

    $form->get('company_name|base')->setAttributes([
        'placeholder' => $this->translate('公司名称')
    ]);

    $form->get('website_icp|base')->setAttributes([
        'placeholder' => $this->translate('填写网站备案号')
    ]);
    ?>
    <?php echo $this->form()->openTag($form); ?>
    <section class="content-header">
        <?php echo $this->partial('layout/breadcrumb'); ?>

        <h1 class="pull-right" id="dberp-menu-top">
            <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-check"></i> <?php echo $this->translate('保存设置'); ?></button>
            <?php echo $this->HelpUrl('system'); ?>
        </h1>
    </section>

    <section class="content">

        <div class="row">
            <div class="col-md-12">
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab_1" data-toggle="tab"><?php echo $this->translate('基本设置'); ?></a></li>
                        <!--li><a href="#tab_2" data-toggle="tab">高级设置</a></li-->
                        <li><a href="#tab_3" data-toggle="tab"><?php echo $this->translate('编码&单号'); ?></a></li>
                        <li><a href="#tab_5" data-toggle="tab"><?php echo $this->translate('发票信息'); ?></a></li>
                        <li><a href="#tab_4" data-toggle="tab"><?php echo $this->translate('其他设置'); ?></a></li>
                    </ul>
                    <div class="tab-content">
                        <?php echo $this->partial('layout/messages'); ?>
                        <div class="tab-pane active" id="tab_1">
                            <div class="box-body">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('公司名称'); ?><span class="must_add_value">*</span></label>
                                    <div class="col-sm-6">
                                        <?php echo $this->formElement($form->get('company_name|base')); ?>
                                        <?php echo $this->formElementErrors($form->get('company_name|base'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('公司Logo'); ?></label>
                                    <div class="col-sm-3">
                                        <?php if (!empty($form->get('company_logo|base')->getValue())) { ?>
                                            <img src="<?php echo $this->basePath($form->get('company_logo|base')->getValue()) . '?v='.time(); ?>" style="max-width: 300px;padding-bottom: 5px;">
                                        <?php } ?>
                                        <?php echo $this->formElement($form->get('company_logo|base')); ?>
                                        <?php echo $this->formElementErrors($form->get('company_logo|base'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('网站备案号'); ?></label>
                                    <div class="col-sm-3">
                                        <?php echo $this->formElement($form->get('website_icp|base')); ?>
                                        <?php echo $this->formElementErrors($form->get('website_icp|base'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('系统时区'); ?><span class="must_add_value">*</span></label>
                                    <div class="col-sm-3">
                                        <?php echo $this->formElement($form->get('website_timezone|base')); ?>
                                        <?php echo $this->formElementErrors($form->get('website_timezone|base'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('系统货币'); ?><span class="must_add_value">*</span></label>
                                    <div class="col-sm-3">
                                        <?php echo $this->formElement($form->get('currency_code|base')); ?>
                                        <?php echo $this->formElementErrors($form->get('currency_code|base'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('商城服务'); ?></label>
                                    <div class="col-sm-3">
                                        <div class="checkbox">
                                            <label>
                                                <?php echo $this->formElement($form->get('shop_service|base')); ?><?php echo $this->translate('启用'); ?>
                                                <?php echo $this->formElementErrors($form->get('shop_service|base'), ['class'=>'error-message']); ?>
                                            </label>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                        <div class="tab-pane" id="tab_2">

                        </div>
                        <div class="tab-pane" id="tab_3">
                            <div class="alert alert-info">
                                <?php echo $this->translate('{y} 代表 年、{m} 代表 月、{d} 代表 日、{h} 代表 时、{i} 代表 分、{s} 代表 秒，例如：{y}{m}{d}{h}{i}{s} 会显示'); ?> 20231212223328
                                <p><?php echo $this->translate('{loginID} 代表 登录ID，例如：{loginID} 会显示 0001 不够4位的会自动补0'); ?></p>
                                <p><?php echo $this->translate('{nextID} 代表 自增ID，例如：{nextID} 会显示 0002 不够4位的会自动补0'); ?></p>
                                <p><?php echo $this->translate('{rand} 代表 随机数，例如：{rand} 会显示 4位随机数'); ?></p>
                                <p><?php echo $this->translate('注意：单号设置一旦保存，不要轻易修改，否则会造成单号重复！登录ID是固定的，如果需要，必须与其他可变标记配合使用。'); ?></p>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-6">
                                    <label class="col-sm-3 control-label"><?php echo $this->translate('商品编码'); ?></label>
                                    <div class="col-sm-8">
                                        <?php echo $this->formElement($form->get('goods|code')); ?>
                                        <?php echo $this->formElementErrors($form->get('goods|code'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="col-xs-6">
                                    <label class="col-sm-3 control-label"><?php echo $this->translate('其他入库单号'); ?></label>
                                    <div class="col-sm-8">
                                        <?php echo $this->formElement($form->get('stock_in|code')); ?>
                                        <?php echo $this->formElementErrors($form->get('stock_in|code'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-xs-6">
                                    <label class="col-sm-3 control-label"><?php echo $this->translate('分类编码'); ?></label>
                                    <div class="col-sm-8">
                                        <?php echo $this->formElement($form->get('category|code')); ?>
                                        <?php echo $this->formElementErrors($form->get('category|code'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="col-xs-6">
                                    <label class="col-sm-3 control-label"><?php echo $this->translate('其他出库单号'); ?></label>
                                    <div class="col-sm-8">
                                        <?php echo $this->formElement($form->get('stock_ex|code')); ?>
                                        <?php echo $this->formElementErrors($form->get('stock_ex|code'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-6">
                                    <label class="col-sm-3 control-label"><?php echo $this->translate('品牌编码'); ?></label>
                                    <div class="col-sm-8">
                                        <?php echo $this->formElement($form->get('brand|code')); ?>
                                        <?php echo $this->formElementErrors($form->get('brand|code'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="col-xs-6">
                                    <label class="col-sm-3 control-label"><?php echo $this->translate('库存盘点单号'); ?></label>
                                    <div class="col-sm-8">
                                        <?php echo $this->formElement($form->get('stock_check|code')); ?>
                                        <?php echo $this->formElementErrors($form->get('stock_check|code'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-6">
                                    <label class="col-sm-3 control-label"><?php echo $this->translate('仓库编码'); ?></label>
                                    <div class="col-sm-8">
                                        <?php echo $this->formElement($form->get('warehouse|code')); ?>
                                        <?php echo $this->formElementErrors($form->get('warehouse|code'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="col-xs-6">
                                    <label class="col-sm-3 control-label"><?php echo $this->translate('库间调拨单号'); ?></label>
                                    <div class="col-sm-8">
                                        <?php echo $this->formElement($form->get('stock_transfer|code')); ?>
                                        <?php echo $this->formElementErrors($form->get('stock_transfer|code'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-xs-6">
                                    <label class="col-sm-3 control-label"><?php echo $this->translate('客户编码'); ?></label>
                                    <div class="col-sm-8">
                                        <?php echo $this->formElement($form->get('customer|code')); ?>
                                        <?php echo $this->formElementErrors($form->get('customer|code'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="col-xs-6">
                                    <label class="col-sm-3 control-label"><?php echo $this->translate('采购单号'); ?></label>
                                    <div class="col-sm-8">
                                        <?php echo $this->formElement($form->get('purchase_order|code')); ?>
                                        <?php echo $this->formElementErrors($form->get('purchase_order|code'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-6">
                                    <label class="col-sm-3 control-label"><?php echo $this->translate('客户分类编码'); ?></label>
                                    <div class="col-sm-8">
                                        <?php echo $this->formElement($form->get('customer_category|code')); ?>
                                        <?php echo $this->formElementErrors($form->get('customer_category|code'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="col-xs-6">
                                    <label class="col-sm-3 control-label"><?php echo $this->translate('采购入库单号'); ?></label>
                                    <div class="col-sm-8">
                                        <?php echo $this->formElement($form->get('warehouse_order|code')); ?>
                                        <?php echo $this->formElementErrors($form->get('warehouse_order|code'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-6">
                                    <label class="col-sm-3 control-label"><?php echo $this->translate('供应商编码'); ?></label>
                                    <div class="col-sm-8">
                                        <?php echo $this->formElement($form->get('supplier|code')); ?>
                                        <?php echo $this->formElementErrors($form->get('supplier|code'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="col-xs-6">
                                    <label class="col-sm-3 control-label"><?php echo $this->translate('销售单号'); ?></label>
                                    <div class="col-sm-8">
                                        <?php echo $this->formElement($form->get('sales_order|code')); ?>
                                        <?php echo $this->formElementErrors($form->get('sales_order|code'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-6">
                                    <label class="col-sm-3 control-label"><?php echo $this->translate('供应商分类编码'); ?></label>
                                    <div class="col-sm-8">
                                        <?php echo $this->formElement($form->get('supplier_category|code')); ?>
                                        <?php echo $this->formElementErrors($form->get('supplier_category|code'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="col-xs-6">
                                    <label class="col-sm-3 control-label"><?php echo $this->translate('发货单号'); ?></label>
                                    <div class="col-sm-8">
                                        <?php echo $this->formElement($form->get('sales_send_order|code')); ?>
                                        <?php echo $this->formElementErrors($form->get('sales_send_order|code'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane" id="tab_4">
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><?php echo $this->translate('库存预警'); ?></label>
                                <div class="col-sm-2">
                                    <div class="input-group">
                                        <span class="input-group-addon"><?php echo $this->translate('最低库存'); ?></span>
                                        <?php echo $this->formElement($form->get('stock_min_warning|other')); ?>
                                    </div>
                                    <?php echo $this->formElementErrors($form->get('stock_min_warning|other'), ['class'=>'error-message']); ?>
                                </div>

                                <div class="col-sm-2">
                                    <div class="input-group">
                                        <span class="input-group-addon"><?php echo $this->translate('最高库存'); ?></span>
                                        <?php echo $this->formElement($form->get('stock_max_warning|other')); ?>
                                    </div>
                                    <?php echo $this->formElementErrors($form->get('stock_max_warning|other'), ['class'=>'error-message']); ?>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><?php echo $this->translate('商品图片显示宽高'); ?></label>
                                <div class="col-sm-2">
                                    <div class="input-group">
                                        <?php echo $this->formElement($form->get('image_width|other')); ?>
                                        <span class="input-group-addon">px</span>
                                    </div>
                                    <?php echo $this->formElementErrors($form->get('image_width|other'), ['class'=>'error-message']); ?>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><?php echo $this->translate('登录验证码'); ?></label>
                                <div class="col-sm-2">
                                    <div class="checkbox">
                                        <label>
                                            <?php echo $this->formElement($form->get('login_captcha|other')); ?><?php echo $this->translate('启用'); ?>
                                            <?php echo $this->formElementErrors($form->get('login_captcha|other'), ['class'=>'error-message']); ?>
                                        </label>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="tab-pane" id="tab_5">
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><?php echo $this->translate('公司统一信用代码/税号'); ?></label>
                                <div class="col-sm-3">
                                    <?php echo $this->formElement($form->get('company_tax_number|base')); ?>
                                    <?php echo $this->formElementErrors($form->get('company_tax_number|base'), ['class'=>'error-message']); ?>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><?php echo $this->translate('公司地址'); ?></label>
                                <div class="col-sm-5">
                                    <?php echo $this->formElement($form->get('company_address|base')); ?>
                                    <?php echo $this->formElementErrors($form->get('company_address|base'), ['class'=>'error-message']); ?>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><?php echo $this->translate('公司电话'); ?></label>
                                <div class="col-sm-2">
                                    <?php echo $this->formElement($form->get('company_phone|base')); ?>
                                    <?php echo $this->formElementErrors($form->get('company_phone|base'), ['class'=>'error-message']); ?>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><?php echo $this->translate('公司开户银行'); ?></label>
                                <div class="col-sm-5">
                                    <?php echo $this->formElement($form->get('company_bank|base')); ?>
                                    <?php echo $this->formElementErrors($form->get('company_bank|base'), ['class'=>'error-message']); ?>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><?php echo $this->translate('公司银行账户'); ?></label>
                                <div class="col-sm-3">
                                    <?php echo $this->formElement($form->get('company_bank_account|base')); ?>
                                    <?php echo $this->formElementErrors($form->get('company_bank_account|base'), ['class'=>'error-message']); ?>
                                </div>
                            </div>
                        </div>

                    </div>

                        <div class="box-footer text-center">
                            <button type="submit" class="btn btn-primary"><i class="fa fa-check"></i> <?php echo $this->translate('保存设置'); ?></button>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </section>
    <?php echo $this->form()->closeTag(); ?>
</div>
<script type="text/javascript">
    $('.select2').select2();
</script>